<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 定义一个v-big指令，和v-text功能类似，会把绑定的数值放大10倍-->
    <div id="app">
        <h2>当前的值是<span v-text="n"></span></h2>
        <h2>放大10倍的值是：<span v-big="n"></span></h2>
        <button @click="n++">点我n+1</button>
    </div>
    
    <script src="../JS/vue.js"></script>
    <script>
        new Vue({
            el:'#app',
            data() {
                return {
                    n:1
                }
            },
            directives:{
                big(element,binding){
                    //element 元素
                    //binding 值
                    element.innerText = binding.value*10
                    console.log(binding.value);
                }
            },
        })
    </script>
</body>
</html>